import request from '@/utils/request';
export const getCommentApi = (id: string, type: 'a' | 'c', last_id?: string) => {
  return request({ url: '/v1_0/comments', params: { type, source: id, offset: last_id } });
};
export interface sendCommentData {
  target: string;
  content: string;
  art_id?: string;
}

//发送评论
export const sendCommentApi = (data: sendCommentData) => {
  return request({
    url: '/v1_0/comments',
    method: 'POST',
    data,
  });
};
//对评论点赞
export const likeCommentApi = (id: string) => {
  return request({ url: '/v1_0/comment/likings', method: 'POST', data: { target: id } });
};

//取消对评论点赞
export const unlikeCommentApi = (id: string) => {
  return request({ url: `/v1_0/comment/likings/${id}`, method: 'DELETE' });
};
